import request from "@/utils/request";

// 文章列表
export function getArticleList(params) {
  return request({
  url: "/article/list",
    method: "get",
    params,
  });
}

// 根据id删除对应文章
export function deleteArticleById(id) {
  return request({
  url: `/article/delete/${id}`,
    method: "delete",
  });
}

// 文章添加
export function addArticle(data) {
  return request({
  url: "/article/add",
    method: "post",
    data,
  });
}

// 修改文章信息
export function updateArticle(id, data) {
  return request({
  url: `/article/update/${id}`,
    method: "post",
    data,
  });
}

// 根据文章名称、编号、状态搜索
export function searchArticle(params) {
  return request ({
    url: '/article/search',
    method: 'get',
    params
  });
}
